package com.atguigu.gmall.activity.redis;

import org.springframework.stereotype.Component;

/**
 * 自定义Redis监听器
 *      接收到消息，自定义的处理实现类
 */
@Component
public class MessageReceive {

    //接收消息   "30:1"
    public void receiveMessage(String message){
        System.out.println("redis:message:" + message);

        //本地内存中 JUC
        String[] split = message.replaceAll("\"","").split(":");
        CacheHelper.put(split[0],split[1]);
    }
}
